package com.yuedao.sender.model1;

import javax.persistence.*;

/**
 * AssistDemo
 * com.chris.demo.model.orm
 * Created by Chris Chen
 * 2018/1/5
 * Explain:
 */
@Entity(name = "ydx_service_places")
public class ServicePlaceEntity {
    private int id;
    private String fullName;
    private String shortName;
    private String address;
    private int longitude;
    private int latitude;
    private String description;
    private int cityDistrictId;
    private Integer cityId;
    private int serviceTypeId;
    private Integer airportId;
    private Integer available;
    private Integer priceCodeId;
    private Integer promotionCodeId;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id", nullable = false)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "full_name", nullable = false, length = 128)
    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    @Basic
    @Column(name = "short_name", nullable = false, length = 32)
    public String getShortName() {
        return shortName;
    }

    public void setShortName(String shortName) {
        this.shortName = shortName;
    }

    @Basic
    @Column(name = "address", nullable = false, length = 1024)
    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Basic
    @Column(name = "longitude", nullable = false)
    public int getLongitude() {
        return longitude;
    }

    public void setLongitude(int longitude) {
        this.longitude = longitude;
    }

    @Basic
    @Column(name = "latitude", nullable = false)
    public int getLatitude() {
        return latitude;
    }

    public void setLatitude(int latitude) {
        this.latitude = latitude;
    }

    @Basic
    @Column(name = "description", nullable = true, length = 2048)
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "city_district_id", nullable = false)
    public int getCityDistrictId() {
        return cityDistrictId;
    }

    public void setCityDistrictId(int cityDistrictId) {
        this.cityDistrictId = cityDistrictId;
    }

    @Basic
    @Column(name = "city_id", nullable = true)
    public Integer getCityId() {
        return cityId;
    }

    public void setCityId(Integer cityId) {
        this.cityId = cityId;
    }

    @Basic
    @Column(name = "service_type_id", nullable = false)
    public int getServiceTypeId() {
        return serviceTypeId;
    }

    public void setServiceTypeId(int serviceTypeId) {
        this.serviceTypeId = serviceTypeId;
    }

    @Basic
    @Column(name = "airport_id", nullable = true)
    public Integer getAirportId() {
        return airportId;
    }

    public void setAirportId(Integer airportId) {
        this.airportId = airportId;
    }

    @Basic
    @Column(name = "available", nullable = true)
    public Integer getAvailable() {
        return available;
    }

    public void setAvailable(Integer available) {
        this.available = available;
    }

    @Basic
    @Column(name = "price_code_id", nullable = true)
    public Integer getPriceCodeId() {
        return priceCodeId;
    }

    public void setPriceCodeId(Integer priceCodeId) {
        this.priceCodeId = priceCodeId;
    }

    @Basic
    @Column(name = "promotion_code_id", nullable = true)
    public Integer getPromotionCodeId() {
        return promotionCodeId;
    }

    public void setPromotionCodeId(Integer promotionCodeId) {
        this.promotionCodeId = promotionCodeId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ServicePlaceEntity that = (ServicePlaceEntity) o;

        if (id != that.id) return false;
        if (longitude != that.longitude) return false;
        if (latitude != that.latitude) return false;
        if (cityDistrictId != that.cityDistrictId) return false;
        if (serviceTypeId != that.serviceTypeId) return false;
        if (fullName != null ? !fullName.equals(that.fullName) : that.fullName != null) return false;
        if (shortName != null ? !shortName.equals(that.shortName) : that.shortName != null) return false;
        if (address != null ? !address.equals(that.address) : that.address != null) return false;
        if (description != null ? !description.equals(that.description) : that.description != null) return false;
        if (cityId != null ? !cityId.equals(that.cityId) : that.cityId != null) return false;
        if (airportId != null ? !airportId.equals(that.airportId) : that.airportId != null) return false;
        if (available != null ? !available.equals(that.available) : that.available != null) return false;
        if (priceCodeId != null ? !priceCodeId.equals(that.priceCodeId) : that.priceCodeId != null) return false;
        if (promotionCodeId != null ? !promotionCodeId.equals(that.promotionCodeId) : that.promotionCodeId != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (fullName != null ? fullName.hashCode() : 0);
        result = 31 * result + (shortName != null ? shortName.hashCode() : 0);
        result = 31 * result + (address != null ? address.hashCode() : 0);
        result = 31 * result + longitude;
        result = 31 * result + latitude;
        result = 31 * result + (description != null ? description.hashCode() : 0);
        result = 31 * result + cityDistrictId;
        result = 31 * result + (cityId != null ? cityId.hashCode() : 0);
        result = 31 * result + serviceTypeId;
        result = 31 * result + (airportId != null ? airportId.hashCode() : 0);
        result = 31 * result + (available != null ? available.hashCode() : 0);
        result = 31 * result + (priceCodeId != null ? priceCodeId.hashCode() : 0);
        result = 31 * result + (promotionCodeId != null ? promotionCodeId.hashCode() : 0);
        return result;
    }
}
